package com.idealighter.game.roomcard.handler;

import com.google.inject.Inject;

import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.roomcard.manager.RoomCardMgr;
import com.idealighter.game.roomcard.message.ReqEnterRoomCardMsg;
import com.idealighter.game.server.handler.ReqMessageHandler;

@ReqMsgHandler(ModuleMsgIdConstant.RoomCard.ENTER_ROOM_CARD)
public class ReqEnterRoomCardHandler implements ReqMessageHandler {
  @Inject
  private RoomCardMgr roomCardMgr;

  @Override
  public ResMessage action(Player player, ReqMessage msg) {
    ReqEnterRoomCardMsg message = (ReqEnterRoomCardMsg) msg;
    return roomCardMgr.enterRoomCard(player, message.getRoomId());
  }
}
